<?php defined ( 'SUROBOT' ) or exit ( 'No direct script access allowed' );
/**
 * 茉莉机器人接口功能操作静态类
 * @author WispX
 * @copyright WispX
 * @link http://www.xlogs.cn
 */

class MoliPer extends CommonPer {
	
	public static function SendMsg($str)
	{
		$moli = self::getMoliConfig();
		$result = array();
		$result['code'] = 1;
		$data = array(
				'api_key' 		=> $moli['api_key'],
				'api_secret'	=> $moli['api_secret'],
				'question'		=> $str
		);
		$result['text']= Fun::Curl($moli['api_url'], $data);
		if(!$result['text']) $result['text'] = "接口请求异常！如果您是管理员请检查配置是否正确！";
		return json_encode($result);
	}
	
}

?>